<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="__STATIC__/js/jquery-3.6.0.min.js"></script>
</head>
<body>
    验证码：<input type="text" value="" id='mycaptcha' />
    <div>{:captcha_img()}</div>
    <button type="button" onclick="checapa()">提交验证码</button>
    <br />
    {$test}<br />
    {$defaultderive}
</body>
</html>
<script>
    function checapa()
    {
        var capastr=$("#mycaptcha").val();
        if(capastr==""){alert("验证码不能为空");return false;}
        $.ajax({
            url:"ck",
            type:'POST',
            data:{capastr:capastr},
            async:false,
            error:{
            },
            success:function(res)
            {
                alert(res.msg);
                console.log(res);
            }
        });
    }
</script>